xen.git
17 years agox86: No need to vcpu_update_system_time() on map_vcpu_info().
Keir Fraser [Tue, 15 Jul 2008 16:56:25 +0000 (17:56 +0100)]
x86: No need to vcpu_update_system_time() on map_vcpu_info().
Also, ensure update_vcpu_system_time() triggers at least once for any
given vcpu, even if the TSC stamp is zero.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxen: Small cleanups towards allowing stricter compile warnings.
Keir Fraser [Tue, 15 Jul 2008 15:13:46 +0000 (16:13 +0100)]
xen: Small cleanups towards allowing stricter compile warnings.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoiommu: disable by default. 'iommu' on cmdline to enable.
Keir Fraser [Tue, 15 Jul 2008 14:36:50 +0000 (15:36 +0100)]
iommu: disable by default. 'iommu' on cmdline to enable.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agotools: Make functions static which should not be exported.
Keir Fraser [Tue, 15 Jul 2008 14:03:58 +0000 (15:03 +0100)]
tools: Make functions static which should not be exported.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agox86: Add clocksource=tsc option.
Keir Fraser [Tue, 15 Jul 2008 13:04:02 +0000 (14:04 +0100)]
x86: Add clocksource=tsc option.

This option should only be used on machines where TSC is known to be
synchronized across all processors.  A future TODO is to dynamically
determine if this is the case.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: platform-timer read function returns 64 bits.
Keir Fraser [Tue, 15 Jul 2008 12:36:22 +0000 (13:36 +0100)]
x86: platform-timer read function returns 64 bits.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agotools: Declare functions static where they should be, and provide
Keir Fraser [Tue, 15 Jul 2008 12:19:26 +0000 (13:19 +0100)]
tools: Declare functions static where they should be, and provide
proper prototypes for others as required.

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agostubdom: enable compilation/installation by default
Keir Fraser [Mon, 14 Jul 2008 14:21:03 +0000 (15:21 +0100)]
stubdom: enable compilation/installation by default

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agovt-d: Disable VT-d if parsing ACPI DMAR fails
Keir Fraser [Mon, 14 Jul 2008 14:20:35 +0000 (15:20 +0100)]
vt-d: Disable VT-d if parsing ACPI DMAR fails

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoxentop: declare signal handler as static
Keir Fraser [Mon, 14 Jul 2008 12:26:45 +0000 (13:26 +0100)]
xentop: declare signal handler as static
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agoRevert 18025:07c7aef164 -- go back to 8MB VRAM.
Keir Fraser [Mon, 14 Jul 2008 12:13:39 +0000 (13:13 +0100)]
Revert 18025:07c7aef164 -- go back to 8MB VRAM.

We may well want it in future anyway, and changing it makes
save/restore compatibility difficult.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: PIT broadcast to fix local APIC timer stop issue for Deep C state
Keir Fraser [Mon, 14 Jul 2008 09:43:32 +0000 (10:43 +0100)]
x86: PIT broadcast to fix local APIC timer stop issue for Deep C state

Local APIC timer may stop at deep C state (C3/C4...) entry. Initial
HPET broadcast working in legacy replacing mode, broke RTC intr, so
was bypassed. This patch add the logic that use platform timer (PIT)
to reenable local APIC timer at C state entry/exit.

Currently, only keep PIT enabled with 100Hz freq. The next step is
trying to dynamically enable/disable PIT while needed, and give it
lower freq.

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
Signed-off-by: Wei Gang <gang.wei@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm: vt-d: Add a command "xm pci-list-assignable-devices" to list all
Keir Fraser [Mon, 14 Jul 2008 09:12:07 +0000 (10:12 +0100)]
xm: vt-d: Add a command "xm pci-list-assignable-devices" to list all
the assignable devices.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: vt-d: improved FLR logic for pass-thru PCI devices
Keir Fraser [Mon, 14 Jul 2008 09:11:39 +0000 (10:11 +0100)]
xend: vt-d: improved FLR logic for pass-thru PCI devices

1) If the device is PCIe endpoint and supports PCIe FLR, we use that;
else

2) if the device is PCIe endpoint, and all functions on the
device are assigned to the same guest, we use the immediate parent
bus's Secondary Bus Reset to reset all functions of the device (here,
actually we require all the functions of the device be assigned to the
same guest); else

3) if the device is PCI endpoint and is on a host bus
(e.g. integrated devices), and if the device supports PCI Advanced
Capabilities, we use that for FLR; else

4) we use the Secondary Bus Reset (if the PCI device is behind a
PCI/PCI-X bridge, then all devices behind the uppermost such PCI/PCI-X
bridge above this device must be co-assigned).

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agovt-d: Remove the FLR logic in Xen.
Keir Fraser [Mon, 14 Jul 2008 09:10:14 +0000 (10:10 +0100)]
vt-d: Remove the FLR logic in Xen.

The current simple logic has some issues: 1) Dstate transition is not
guaranteed to properly clear the device state; 2) the current code for
PCIe FLR is actually buggy: PCI_EXP_DEVSTA_TRPND doesn't mean the
completion of FLR; according to the PCIe spec, after issuing FLR, we
should wait at least 100ms.

The improved FLR logic will be added into xend.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoxend: A small cleanup to the find_sysfs_mnt() of pci.py
Keir Fraser [Mon, 14 Jul 2008 09:09:25 +0000 (10:09 +0100)]
xend: A small cleanup to the find_sysfs_mnt() of pci.py
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agoioemu: sdl without OpenGl fix
Keir Fraser [Mon, 14 Jul 2008 09:07:11 +0000 (10:07 +0100)]
ioemu: sdl without OpenGl fix
Signed-off-by: Frederic Guihery <sygus@cat-lan.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
17 years agoChoice of network interface for establishing a bridge on if NFSROOT is used
Keir Fraser [Mon, 14 Jul 2008 09:04:41 +0000 (10:04 +0100)]
Choice of network interface for establishing a bridge on if NFSROOT is used

This patch fixes a problem related to machines that are booted using
nfsroot ( '/' provided via nfs). Previously the code was assuming that
nfsroot would be provided via eth0. Now this additional code checks
over which interface the nfsroot is provided after detecting that
nfsroot is actually being used. To determine from where nfsroot is
mounted I am reading the kernel command line (/proc/cmdline) and
filter for an argument starting with 'nfsroot=' and determine the nfs
server's IP address by assuming the format 'nfsroot=<ip
adddress>:<path to root>' - if there's a better way of doing this,
please let me know.  After that I determine the interface over which
this IP address would be accessed using 'ip route get <address>'. Then
I compare that interface against a previously determined default
interface and if they are equal return a value that causes an
alternative interface to be chosen.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoblktap: portability cleanup
Keir Fraser [Mon, 14 Jul 2008 09:03:09 +0000 (10:03 +0100)]
blktap: portability cleanup
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agostubdom: missing fixes for old gcc
Keir Fraser [Mon, 14 Jul 2008 09:00:47 +0000 (10:00 +0100)]
stubdom: missing fixes for old gcc

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: fixes for old gcc & binutils
Keir Fraser [Fri, 11 Jul 2008 14:37:31 +0000 (15:37 +0100)]
stubdom: fixes for old gcc & binutils

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoblktap: cleanup
Keir Fraser [Fri, 11 Jul 2008 14:36:40 +0000 (15:36 +0100)]
blktap: cleanup

Make functions w/o a prototype static and remove redundant
declaration of xs_fire_next_watch().

Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agolibxc: remove redundant declaration of xc_copy_to_domain_page().
Keir Fraser [Fri, 11 Jul 2008 14:35:50 +0000 (15:35 +0100)]
libxc: remove redundant declaration of xc_copy_to_domain_page().
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agox86: allow control domain to limit machine addresses given to a particular guest
Keir Fraser [Fri, 11 Jul 2008 11:51:26 +0000 (12:51 +0100)]
x86: allow control domain to limit machine addresses given to a particular guest

This allows domains which make buggy assumptions about the maximum
possible MFN to be worked around.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years agoiommu: make interrupt remapping more generic
Keir Fraser [Fri, 11 Jul 2008 11:49:14 +0000 (12:49 +0100)]
iommu: make interrupt remapping more generic
Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoamd iommu: add interrupt remapping support
Keir Fraser [Fri, 11 Jul 2008 11:48:45 +0000 (12:48 +0100)]
amd iommu: add interrupt remapping support
Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoxend: Ignore errors from dying domains in RPC server
Keir Fraser [Fri, 11 Jul 2008 11:47:50 +0000 (12:47 +0100)]
xend: Ignore errors from dying domains in RPC server

When a domain is in the process of shutting down there is a small
window when the domain is known to XenD, but it will be unable to form
an SXPR for it due it being in the middle of device hot-unplug. This
causes the 'xm list' command to totally fail with an error like

# xm list
Error: Device 0 not connected
Usage: xm list [options] [Domain, ...]

The 'xm list' command calls into the 'domains' method of
XMLRPCServer.py in XenD. This method just iterates over the list of
domains, fetching the sxpr for each in turn, but with no exception
handling. So if a single domain fails to generate an sxpr, no data is
returned even for other domains which are still functional.  This
patch simply makes XenD ignore and skip over domains which throw an
exception, logging the problematic domain.

NB, this problem only hits 'xm list' if it is configured to use the
legay XMLRPC server instead of XenAPI.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
17 years agovt-d: Fix Host Address Width
Keir Fraser [Fri, 11 Jul 2008 11:46:33 +0000 (12:46 +0100)]
vt-d: Fix Host Address Width

Host Address Width of the platform should be computed as N+1,
where N is the value reported in dmar acpi table.

Signed-off-by: Ameya Palande <2ameya@gmail.com>
17 years agostubdom: do not use realpath, new in make 3.81
Keir Fraser [Fri, 11 Jul 2008 11:45:06 +0000 (12:45 +0100)]
stubdom: do not use realpath, new in make 3.81

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoFix memory leak in xend
Keir Fraser [Fri, 11 Jul 2008 11:44:15 +0000 (12:44 +0100)]
Fix memory leak in xend
Signed-off-by: Jim Fehlig <jfehlig@novell.com>
17 years agotapdisk: in case O_DIRECT fails, retry again with o_flags but
Keir Fraser [Fri, 11 Jul 2008 11:43:33 +0000 (12:43 +0100)]
tapdisk: in case O_DIRECT fails, retry again with o_flags but
O_DIRECT, instead of fixed value O_RD_WR | O_LARGEFILE

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: drop shadow vram
Keir Fraser [Fri, 11 Jul 2008 11:33:00 +0000 (12:33 +0100)]
ioemu: drop shadow vram

We can now actually drop the shadow vram entirely thanks to dirty page
tracking.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agohvmloader, rombios: Make use of new rom-lock facility in ioemu platform device.
Keir Fraser [Fri, 11 Jul 2008 11:31:32 +0000 (12:31 +0100)]
hvmloader, rombios: Make use of new rom-lock facility in ioemu platform device.
Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovt-d: Fixup when mapping devices on non-PCIe buses
Keir Fraser [Thu, 10 Jul 2008 16:33:23 +0000 (17:33 +0100)]
vt-d: Fixup when mapping devices on non-PCIe buses

The source-id for transactions on non-PCIe buses seem to originate
from devfn=0 on the secondary bus behind the bridge.  Map that ID as
well when assigning the device.  The ID to use in these scenarios is
not particularly well documented anywhere.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoioemu: drop unused 4MB video memory
Keir Fraser [Thu, 10 Jul 2008 16:29:06 +0000 (17:29 +0100)]
ioemu: drop unused 4MB video memory

Since we only emulate the cirrus VGA video card which is only able to
expose 4MB video memory, we don't need more than that.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: create a rom-protect platform flag.
Keir Fraser [Thu, 10 Jul 2008 15:15:37 +0000 (16:15 +0100)]
ioemu: create a rom-protect platform flag.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 hvm: New boot option 'softtsc' to cause RDTSC to be trapped-and-emulated.
Keir Fraser [Thu, 10 Jul 2008 14:45:18 +0000 (15:45 +0100)]
x86 hvm: New boot option 'softtsc' to cause RDTSC to be trapped-and-emulated.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: Fixes for gcc 4.2.4 32bit
Keir Fraser [Thu, 10 Jul 2008 14:32:18 +0000 (15:32 +0100)]
stubdom: Fixes for gcc 4.2.4 32bit
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86 hvm: New hvm_op "set_mem_type" which allows marking ram page
Keir Fraser [Thu, 10 Jul 2008 14:30:39 +0000 (15:30 +0100)]
x86 hvm: New hvm_op "set_mem_type" which allows marking ram page
ranges as ro, rw, or mmio_dm.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
17 years agox86: Do not allow write access to p2m_ram_ro memory type.
Keir Fraser [Thu, 10 Jul 2008 14:19:56 +0000 (15:19 +0100)]
x86: Do not allow write access to p2m_ram_ro memory type.
Log and discard such access attempts.

Signed-off-by: Trolle Selander <trolle.selander@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoPV-GRUB: Enable xfs support
Keir Fraser [Thu, 10 Jul 2008 13:20:15 +0000 (14:20 +0100)]
PV-GRUB: Enable xfs support

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoPV-GRUB: xfs support
Keir Fraser [Thu, 10 Jul 2008 13:17:28 +0000 (14:17 +0100)]
PV-GRUB: xfs support

i386 doesn't have PAE anyway.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: fixes to compile with qemu-xen
Keir Fraser [Thu, 10 Jul 2008 13:15:46 +0000 (14:15 +0100)]
stubdom: fixes to compile with qemu-xen

This adds fixes to the stub domain build into compiling Ian Jackson's
qemu-xen.  The most notable change is that mini-os headers now
#include each other through a mini-os/ prefix, so that we can turn all
-I into -isystem and still be sure that we include Mini-OS headers
(and not qemu's console.h or blktaplib's list.h for instance...).

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agointel: Stricter check for cpuid feature mask MSR availability.
Keir Fraser [Thu, 10 Jul 2008 10:26:42 +0000 (11:26 +0100)]
intel: Stricter check for cpuid feature mask MSR availability.

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Jun Nakajima <nakajima.jun@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovt-d: Fix double spin_lock_irqsave().
Keir Fraser [Thu, 10 Jul 2008 09:07:32 +0000 (10:07 +0100)]
vt-d: Fix double spin_lock_irqsave().

The duplicate spin_lock_irqsave() flushes the original EFLAGS saved,
and thus disables local irqs permanently.

Signed-off-by: Xin, Xiaohui <Xiaohui.xin@intel.com>
Signed-off-by: Tian, Kevin <Kevin.Tian@intel.com>
17 years agoFix a couple of Grzegorz Milos copyright lines.
Keir Fraser [Thu, 10 Jul 2008 09:02:15 +0000 (10:02 +0100)]
Fix a couple of Grzegorz Milos copyright lines.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agominios: Add missing fcntl.h.
Keir Fraser [Wed, 9 Jul 2008 15:00:05 +0000 (16:00 +0100)]
minios: Add missing fcntl.h.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: add stub functions to reduce qemu patches
Keir Fraser [Wed, 9 Jul 2008 14:58:20 +0000 (15:58 +0100)]
stubdom: add stub functions to reduce qemu patches

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: Add root Makefile targets, disabled by default for now
Keir Fraser [Wed, 9 Jul 2008 13:21:42 +0000 (14:21 +0100)]
stubdom: Add root Makefile targets, disabled by default for now

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoMake PCI device release function generic
Keir Fraser [Wed, 9 Jul 2008 13:08:58 +0000 (14:08 +0100)]
Make PCI device release function generic

Release all pci devices before doing iommu domain teardown.  Also
moved pdev_flr() into generic pci code.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agostubdom: fix missing evtchn.h header
Keir Fraser [Wed, 9 Jul 2008 12:01:16 +0000 (13:01 +0100)]
stubdom: fix missing evtchn.h header

We actually do not need any since we include MiniOS' headers.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoUpdate .hgignore
Keir Fraser [Wed, 9 Jul 2008 12:00:23 +0000 (13:00 +0100)]
Update .hgignore

17 years agovgabios: Delete autogenerated file from repository.
Keir Fraser [Wed, 9 Jul 2008 11:59:40 +0000 (12:59 +0100)]
vgabios: Delete autogenerated file from repository.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: make compilation independent of tools/ by building our own copy of the includes
Keir Fraser [Wed, 9 Jul 2008 10:51:46 +0000 (11:51 +0100)]
stubdom: make compilation independent of tools/ by building our own copy of the includes

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoSome latest Intel CPU models support cpuid feature mask.
Keir Fraser [Wed, 9 Jul 2008 10:42:45 +0000 (11:42 +0100)]
Some latest Intel CPU models support cpuid feature mask.

CPUID.1.EAX>0x00010674.CPUID mask feature is intended to be used to
limit the feature flags reported by CPUID.1.EDX:ECX.

Signed-off-by: Liping Ke <liping.ke@intel.com>
Signed-off-by: Jun Nakajima <nakajima.jun@intel.com>
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoSwitching to merged (git) qemu by default
Keir Fraser [Wed, 9 Jul 2008 10:05:26 +0000 (11:05 +0100)]
Switching to merged (git) qemu by default

The merged qemu tree is now on xenbits at:
   http://xenbits.xensource.com/git-http/qemu-xen-unstable.git
(and a corresponding staging tree in /staging).

That's a raw git tree fetchable by `git-clone http://....', so not
really browseable.  There will be gitweb, and a real git server, set
up shortly, as well as a one-way Mercurial gateway.

The tools/ioemu subdirectory will remain in the xen-unstable tree for
this release, as an alternative.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agop2m: Support page orders other than 0 (4kB) and 9 (2MB)
Keir Fraser [Wed, 9 Jul 2008 10:04:18 +0000 (11:04 +0100)]
p2m: Support page orders other than 0 (4kB) and 9 (2MB)
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 p2m superpage fix: Re-insert missing shadow code from the original
Keir Fraser [Wed, 9 Jul 2008 10:02:37 +0000 (11:02 +0100)]
x86 p2m superpage fix: Re-insert missing shadow code from the original
patch that was  submitted to xen-devel, to remove mappings when we're
removing a p2m 2mb page.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agoBlktapctrl compatibility layer
Keir Fraser [Wed, 9 Jul 2008 09:41:49 +0000 (10:41 +0100)]
Blktapctrl compatibility layer

I originally had just changed the NEWINTF ioctl to send over 48-bits
of information, which works on 64-bit but not on 32-bit (since the arg
is an unsigned long).  Additionally, the previous changes would break
an older userland against a new kernel.  For that reason, introduce a
new ioctl (NEWINTF_EXT) that fixes both of these problems.  This is
the dom0 userland side.

Signed-off-by: Chris Lalancette <clalance@redhat.com>
17 years agoioemu: pass-through: XC_PAGE_SIZE should be used
Keir Fraser [Wed, 9 Jul 2008 09:39:42 +0000 (10:39 +0100)]
ioemu: pass-through: XC_PAGE_SIZE should be used

Signed-off-by: KUWAMURA Shin'ya <kuwa@jp.fujitsu.com>
17 years agoioemu: pass-through: pt_bar_mapping fix
Keir Fraser [Wed, 9 Jul 2008 09:39:13 +0000 (10:39 +0100)]
ioemu: pass-through: pt_bar_mapping fix

In pt_bar_mapping function, r->addr should not be changed by invalid
value(-1). This value(-1) causes failure of mapping BAR when I/O Space
or Memory Space enable bit is updated repeatedly by native windows
driver.

This situation occurs in Windows Vista guest.

Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
17 years agoFix xm vcpu-pin for Domain-0
Keir Fraser [Wed, 9 Jul 2008 09:38:20 +0000 (10:38 +0100)]
Fix xm vcpu-pin for Domain-0

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoRevert dependency on new GNUMake feature.
Keir Fraser [Wed, 9 Jul 2008 09:37:20 +0000 (10:37 +0100)]
Revert dependency on new GNUMake feature.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: use a newlib snapshot instead of the slow cvs checkout.
Keir Fraser [Tue, 8 Jul 2008 16:25:04 +0000 (17:25 +0100)]
stubdom: use a newlib snapshot instead of the slow cvs checkout.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: do not build tapdisk as it it not supposed to build and we don't need it
Keir Fraser [Tue, 8 Jul 2008 16:15:23 +0000 (17:15 +0100)]
stubdom: do not build tapdisk as it it not supposed to build and we don't need it

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoChange PCI-dump debug key: Fixes boot with debug=y and perfc=y
Keir Fraser [Tue, 8 Jul 2008 16:03:53 +0000 (17:03 +0100)]
Change PCI-dump debug key: Fixes boot with debug=y and perfc=y
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: fix copy/paste typo in select()
Keir Fraser [Tue, 8 Jul 2008 15:12:23 +0000 (16:12 +0100)]
stubdom: fix copy/paste typo in select()

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoImprove plumbing for calling external qemu builds
Keir Fraser [Tue, 8 Jul 2008 13:26:09 +0000 (14:26 +0100)]
Improve plumbing for calling external qemu builds

* Remove ioemu-dir before replacing it with a symlink so that
  switching between trees doesn't go wrong.
* Remove case-based arrangement for making XEN_ROOT absolute
  and replace with $(abspath ...) since we depend on GNU make
  anyway.
* `make clean' recurses into ioemu-dir

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agostubdom: Fix modified_memory size calculation
Keir Fraser [Tue, 8 Jul 2008 11:24:14 +0000 (12:24 +0100)]
stubdom: Fix modified_memory size calculation
>> is less prioritized than -

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agopvSCSI: fix xend
Keir Fraser [Tue, 8 Jul 2008 08:28:50 +0000 (09:28 +0100)]
pvSCSI: fix xend

Previous "xend" assumed initial Xenbus state would be "Connected" when
LUN hot-plug starts. However it was not guaranteed in general, and it
may cause some problems.

Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
17 years agoFix passthrough of PCI capability structures.
Keir Fraser [Tue, 8 Jul 2008 08:26:58 +0000 (09:26 +0100)]
Fix passthrough of PCI capability structures.
Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
17 years agoRevert c/s 17975 -- enumerate PCI devices in Xen allowing old dom0
Keir Fraser [Mon, 7 Jul 2008 15:13:53 +0000 (16:13 +0100)]
Revert c/s 17975 -- enumerate PCI devices in Xen allowing old dom0
kernels to work with iommu-capable platforms.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoMTRR virtualization for Intel EPT
Keir Fraser [Mon, 7 Jul 2008 09:45:50 +0000 (10:45 +0100)]
MTRR virtualization for Intel EPT
Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com>
17 years agoioemu: e1000: fix a TSE bug
Keir Fraser [Mon, 7 Jul 2008 09:29:56 +0000 (10:29 +0100)]
ioemu: e1000: fix a TSE bug

Previously, all data descriptors used TSE context descriptor. It's not
correct, per spec, data descriptor uses TSE bit to indicate whether
use TSE. Legacy data descripter never use TSE.

Signed-off-by; Anthony Xu <anthony.xu@intel.com>

17 years agoSet default domain_to_node() allocation preference before dropping
Keir Fraser [Sun, 6 Jul 2008 19:16:24 +0000 (20:16 +0100)]
Set default domain_to_node() allocation preference before dropping
domain reference when calling alloc_domheap_pages().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoOnly use domain_to_node() on non-null domain pointer.
Keir Fraser [Sun, 6 Jul 2008 16:22:58 +0000 (17:22 +0100)]
Only use domain_to_node() on non-null domain pointer.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agonuma: Extend MEMOP_ allocation functions to take a node argument.
Keir Fraser [Sat, 5 Jul 2008 13:43:37 +0000 (14:43 +0100)]
numa: Extend MEMOP_ allocation functions to take a node argument.

The address_bits field will be limited to 8 bits and is now embedded
in the mem_flags member, which additionally contains the node number
(limited to 8 bit).

Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoUpdate .hgignore list
Keir Fraser [Sat, 5 Jul 2008 13:42:08 +0000 (14:42 +0100)]
Update .hgignore list

17 years agoOOS cleanup: Fixup arrays instead of fixup tables.
Keir Fraser [Sat, 5 Jul 2008 13:01:27 +0000 (14:01 +0100)]
OOS cleanup: Fixup arrays instead of fixup tables.

This patch avoids compromises with evil concepts (reverse maps) in the
shadow code and limits to a maximum value the number of writable
mappings of OOS pages.

Code is simpler and performance do not degrade.

Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agostubdom: fix pass-through compilation
Keir Fraser [Sat, 5 Jul 2008 13:00:19 +0000 (14:00 +0100)]
stubdom: fix pass-through compilation

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agostubdom: fix parallel build
Keir Fraser [Sat, 5 Jul 2008 13:00:03 +0000 (14:00 +0100)]
stubdom: fix parallel build

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoUpdate changelog for pci add/remove physdevop hypercalls.
Keir Fraser [Sat, 5 Jul 2008 12:58:27 +0000 (13:58 +0100)]
Update changelog for pci add/remove physdevop hypercalls.

17 years agostubdom: gcc-4.3 support
Keir Fraser [Fri, 4 Jul 2008 17:00:04 +0000 (18:00 +0100)]
stubdom: gcc-4.3 support

It seems we need to provide limits.h in the gcc-4.3 case.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoxen: Fix debug build.
Keir Fraser [Fri, 4 Jul 2008 16:58:40 +0000 (17:58 +0100)]
xen: Fix debug build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove PCI device enumaration in VT-d code
Keir Fraser [Fri, 4 Jul 2008 16:55:33 +0000 (17:55 +0100)]
Remove PCI device enumaration in VT-d code

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoAdd hypercall for adding and removing PCI devices
Keir Fraser [Fri, 4 Jul 2008 16:52:50 +0000 (17:52 +0100)]
Add hypercall for adding and removing PCI devices

The add hypercall will add a new PCI device and register it.  The
remove hypercall will remove the pci_dev strucure for the device.  The
IOMMU hardware (if present) will be notifed as well.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
Signed-off-by: Joshua LeVasseur <joshua.levasseur@netronome.com>
17 years agoAdd management and locking of PCI device structures
Keir Fraser [Fri, 4 Jul 2008 16:52:24 +0000 (17:52 +0100)]
Add management and locking of PCI device structures

Add functions for managing pci_dev structures.  Create a list
containing all current pci_devs.  Remove msi_pdev_list.  Create a
read-write lock protecting all pci_dev lists.  Add spinlocks for
pci_dev access.  Do necessary modifications to MSI code.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoRestructure VT-d device scope and PCI bridge handling
Keir Fraser [Fri, 4 Jul 2008 16:51:42 +0000 (17:51 +0100)]
Restructure VT-d device scope and PCI bridge handling

Create a bitmap for each device scope indicating which buses are
covered by the scope.  Upon mapping PCI-PCI bridges we now detect
whether we have a bridge to a non-PCIe bus.  If so, all devices mapped
on that bus are squashed to the requester-id of the bridge.  Bridges
to PCIe busses are ignored.  The requester-id squashing also
determines the iommu device group id for the device.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoPCI device register/unregister + pci_dev cleanups
Keir Fraser [Fri, 4 Jul 2008 16:51:16 +0000 (17:51 +0100)]
PCI device register/unregister + pci_dev cleanups

Move pci_dev lists from hvm to arch_domain

Move the pci_dev list from hvm to arch_domain since PCI devs are no
longer hvm specific.  Also removed locking for pci_dev lists.  Will
reintroduce them later.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agostubdom: Remove obsolete patch files.
Keir Fraser [Fri, 4 Jul 2008 16:50:31 +0000 (17:50 +0100)]
stubdom: Remove obsolete patch files.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agostubdom: use host's gcc
Keir Fraser [Fri, 4 Jul 2008 16:47:11 +0000 (17:47 +0100)]
stubdom: use host's gcc

This makes stubdom use the host's gcc instead of downloading/compiling
binutils+gcc.  That requires a bunch of changes and even uncovered a
few bugs, but saves a lot of time.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agox86: MCA support.
Keir Fraser [Fri, 4 Jul 2008 15:27:44 +0000 (16:27 +0100)]
x86: MCA support.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
17 years agovgabios: upgrade to CVS version
Keir Fraser [Fri, 4 Jul 2008 12:02:31 +0000 (13:02 +0100)]
vgabios: upgrade to CVS version

cvs -z3 -d:pserver:anonymous@cvs.savannah.nongnu.org:/sources/vgabios
co vgabios

Patchs backported:
  - vgabios: Support VESA power management extensions. (cs 17692)
  - x86, hvm: Allow Cirrus VGA BIOS to clear framebuffer with minimal
    PIO writes. (cs 16242)

This patch fixes the bug with the IDR boot CD.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
17 years agoCleanups to suspend-event-channel patches.
Keir Fraser [Fri, 4 Jul 2008 11:39:18 +0000 (12:39 +0100)]
Cleanups to suspend-event-channel patches.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoFix build.
Keir Fraser [Fri, 4 Jul 2008 11:20:19 +0000 (12:20 +0100)]
Fix build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRevert incorrectly checked-in changes.
Keir Fraser [Fri, 4 Jul 2008 11:17:33 +0000 (12:17 +0100)]
Revert incorrectly checked-in changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoTeach xc_save to use event-channel-based domain suspend if available.
Keir Fraser [Fri, 4 Jul 2008 11:00:38 +0000 (12:00 +0100)]
Teach xc_save to use event-channel-based domain suspend if available.
If the guest provides a suspend event channel through xenstore,
xc_save will use it in preference to the old xenstore-based method.

Xend is still informed when the domain has suspended so that it can
perform device migration in parallel with last-round migration.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
17 years agoAdd facility to get notification of domain suspend by event channel.
Keir Fraser [Fri, 4 Jul 2008 11:00:24 +0000 (12:00 +0100)]
Add facility to get notification of domain suspend by event channel.
This event channel will be notified when the domain transitions to the
suspended state, which can be much faster than raising VIRQ_DOM_EXC
and waiting for the notification to be propagated via xenstore.

No attempt is made here to prevent multiple subscribers (last one
wins), or to detect that the subscriber has gone away. Userspace tools
should take care.

Signed-off-by: Brendan Cully <brendan@cs.ubc.ca>
17 years agoioemu: Support more Capability Structures (including MSI/MSI-X)
Keir Fraser [Fri, 4 Jul 2008 10:54:21 +0000 (11:54 +0100)]
ioemu: Support more Capability Structures (including MSI/MSI-X)
       and Device Specific Registers for pt device.

I implemented following Capability Structures and Device Specific
Registers.
    * Configuration Header Type 0
        -> emulation.
           "emulation" does not mean no accessing real I/O device.
           Access real I/O device, but guest value and real value
           might be different.
    * MSI Capability Structure
        -> emulation.
           Behavior is not changed from existed implementation in
           pt-msi.c, although code is changed.
    * MSI-X Capability Structure
        -> emulation.
           Behavior is not changed from existed implementation in
           pt-msi.c, although code is changed.
    * PCI Express Capability Structure
        -> emulation.
    * PCI Power Management Capability Structure
        -> emulation.
    * Vital Product Data Capability Structure
        -> emulation.
           Emulated register is only  Next Capability Pointer
    Register.
           All other registers are passthrough.
    * Vendor Specific Capability Structure
        -> emulation
           Emulated register is only  Next Capability Pointer
    Register.
           All other registers are passthrough.
    * Device Specific Register (exclude capability structures)
        -> passthrough.
           The device drivers in guest domain are allowed to access
           Device Specific Register. So various I/O device will work.

I assigned following device to guest domain, and they worked fine.
    - PCIe NIC (MSI)
    - PCI NIC (MSI)
    - UHCI (INTx interrupt)
    - IDE Controller (INTx interrupt)

Signed-off-by: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
17 years agox86: MSI interrupt storm avoidance.
Keir Fraser [Fri, 4 Jul 2008 10:51:59 +0000 (11:51 +0100)]
x86: MSI interrupt storm avoidance.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>